#! /bin/bash
if [ "$1" = "start" ];then
    echo "start"
elif [ "$1" = "stop" ];then
    echo "stop"
else
    echo "error"
fi

#判断文件是否存在
if [ -f "$2" ];then
    echo "file: "$2
else
    echo "file error"
fi

#判断文件是否具有可执行权限
if [ -x "$2" ];then
    echo "can exec"
else
    echo "no exec"
fi

#判断文件是否具有可写权限
if [ -w "$2" ];then
    echo "can write"
else
    echo "no write"
fi

#判断文件大小是否为0（即文件是否为空）
if [ -s "$2" ];then
    echo "NULL file"
else
    echo "no null file"
fi

#判断是否为目录
if [ -d "$2" ];then
    echo "is dir"
else
    echo "no dir"
fi
